﻿@model EnterpriseFund.Model.DM_PQ
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script type="text/javascript">
        var msg = '@ViewBag.Msg';
        if (msg) {
            if (msg == 'ok') {

                parent.codeOK();

            }
            else {
                alert(msg);
                window.location.reload();
            }
            lp.Hide();
        }
        function OK() {

            lpModal.Show();
            var fPQ_DM = PQ_DM.GetText();
            var fPQ_MC = PQ_MC.GetText();
            var fSWJG_DM = SWJG_DM.GetText();
            var fXYBZ = "";
            var fYXBZ = "";
            var fBZ = BZ.GetText();
            if (tbYXBZ.GetChecked()) {
                fYXBZ = "Y";
            }
            else {
                fYXBZ = "N";
            }
            if (tbXYBZ.GetChecked()) {
                fXYBZ = "Y";
            }
            else {
                fXYBZ = "N";
            }

            if (pd(fPQ_DM, fPQ_MC, fSWJG_DM, fYXBZ, fXYBZ)) {
                form1.submit();
            }


        }


        function pd(codeNo, codeName, fSWJG_DM, fYXBZ, fXYBZ) {
            var bl = true;
            if (null == codeNo || ASPxClientUtils.Trim(codeNo) == "") {
                tbPQ_DM.SetErrorText("请填写代码");
                tbPQ_DM.SetIsValid(false);
                bl = false;
            }
            if (null == codeName || ASPxClientUtils.Trim(codeName) == "") {
                tbPQ_MC.SetErrorText("请填写名称");
                tbPQ_MC.SetIsValid(false);
                bl = false;
            }
            if (null == fSWJG_DM || ASPxClientUtils.Trim(fSWJG_DM) == "") {
                tbPQ_MC.SetErrorText("请填写正确的税务机关代码");
                tbPQ_MC.SetIsValid(false);
                bl = false;
            }

            if (null == fYXBZ || ASPxClientUtils.Trim(fYXBZ) == "") {
                tbYXBZ.SetErrorText("请填写正确的有效标志");
                tbYXBZ.SetIsValid(false);
                bl = false;
            }
            if (null == fXYBZ || ASPxClientUtils.Trim(fXYBZ) == "") {
                tbXYBZ.SetErrorText("请填写正确的选用标志");
                tbXYBZ.SetIsValid(false);
                bl = false;
            }
            return bl;
        }

    </script>
</head>
<body>
    @using (Html.BeginForm("SavaModel", "PQManager", FormMethod.Post, new { id = "form1" }))
    {
        <table class="tableFrom">
            <tr>
                <th style="width: 150">
                    片区代码:
                </th>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "PQ_DM";
                   settings.Width = 150;
                   if ((bool)@ViewData["blcodeNo"])
                   {
                       settings.ReadOnly = false;
                   }
                   else
                   {
                       settings.ReadOnly = true;
                   }
                   settings.Text = Model.PQ_DM;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 150">
                    片区名称:
                </th>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "PQ_MC";
                   settings.Width = 150;
                   settings.Text = Model.PQ_MC;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 150">
                    税务机关代码:
                </th>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "SWJG_DM";
                   settings.Width = 150;
                   settings.Text = Model.SWJG_DM;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 150">
                    有效标志:
                </th>
                <td>
                    @Html.DevExpress().CheckBox(settings =>
               {
                   settings.Name = "tbYXBZ";
                   settings.Width = 150;
                   if (Model.YXBZ == "Y")
                   {
                       settings.Checked = true;
                   }
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 150">
                    选用标志:
                </th>
                <td>
                    @Html.DevExpress().CheckBox(settings =>
               {
                   settings.Name = "tbXYBZ";
                   settings.Width = 150;
                   if (Model.XYBZ == "Y")
                   {
                       settings.Checked = true;
                   }
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 150">
                    备注:
                </th>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "BZ";
                   settings.Width = 150;
                   settings.Text = Model.BZ;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                </td>
            </tr>
        </table>
    }
</body>
</html>
<script>
    
</script>
